﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/admin/Views/Shared/Create.Master"
    Inherits="System.Web.Mvc.ViewPage<Longtop.Web.SaleWeb.Admin.Sales.CreateModel>" %>

<asp:Content ContentPlaceHolderID="Scripts" runat="server" ID="Content2">
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <tr>
        <td>
        </td>
        <td>
            <%= Html.ValidationSummary()%>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model=>model.Model.UserName) %>
        </td>
        <td>
            <%= Model.Model.UserName%>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model=>model.Model.Departments) %>
        </td>
        <td>
            <%var departments = Longtop.Web.WebSite.Models.Lable.GetAllDepartments();
              foreach (var d in departments) {
                  var index = departments.IndexOf(d);
            %>
            <label>
                <input name="Departments[<%= index%>].Text" type="checkbox" value="<%=d.Text %>,true"
                    <%= (Model.Model != null && Model.Model.Departments != null && Model.Model.Departments.ToList().Exists(x => x == d))?"checked='checked'":"" %> />
                <%=d.Text %>
                <input type="hidden" value="<%=d.Text %>,false" name="Departments[<%= index%>].Text" />
                <%=Html.Hidden("Departments[" + index + "].LableId",d.LableId)%>
            </label>
            <%} %>
        </td>
    </tr>
</asp:Content>
